let areaData = []

//将对象中文键转为英文
function toEnKeys(data, keyMap) {
  return data.map((item) => {
    let obj = {}
    for (let prop in item) {
      if (keyMap.hasOwnProperty(prop)) {
        obj[keyMap[prop]] = item[prop]
      }
    }
    return obj
  })
}
function convertArea(data) {
  let keyMap = {
    名称: 'name',
    编号: 'value'
  }
  let chartData = toEnKeys(data, keyMap)
  chartData[0].value = ''
  areaData = chartData
}

function convertAreaJson(data) {
  convertArea(data['地区'])
  return areaData
}
export default convertAreaJson
